#include"proc.h"

void process()
{
    char *flag = "|\\-/";
    char bar[51] = {0};
    int i = 0;
    for(; i <= 50; i++)
    {
	printf("[%-50s][%c]    [%d%%]\r",bar, flag[i%4], i*2);
	fflush(stdout);
	bar[i] = '#';
	usleep(100000);
    }
    printf("\n");
}
void statue()
{
    pid_t id = fork();
    if(id == 0)
    {
	// 子进程
    while(1){
	printf("子进程正在运行，pid =%d ,ppid = %d\n",getpid(),getppid());
	sleep(1);
    }
    }
    else
    {
	// 父进程
    while(1){
	printf("父进程正在运行，pid =%d ,ppid = %d\n",getpid(),getppid());
	sleep(1);
    }
    }
}
